package org.totoro.patterns.behavior.chain.of.responsebility;

/**
 * Created by renkai on 2017/3/21.
 */
public abstract class AbstractHandler {
    private Handler handler;

    private Integer sortIndex;

    public Handler getHandler() {
        return handler;
    }

    public AbstractHandler setHandler(Handler handler) {
        this.handler = handler;
        return this;
    }

    public Integer sort() {
        return sortIndex == null ? Integer.MIN_VALUE : sortIndex;
    }

    public AbstractHandler setSortIndex(Integer sortIndex) {
        this.sortIndex = sortIndex;
        return this;
    }
}
